package org.springextensions.actionscript.ioc
{
	import org.as3commons.logging.ILogger;
	import org.as3commons.logging.LoggerFactory;
	import org.springextensions.actionscript.mvcs.service.operation.AbstractOperation;
	import org.springextensions.actionscript.mvcs.service.operation.IOperation;
	import org.springextensions.actionscript.resource.IResourceDefinition;
	
	public class ResourceDefinition extends AbstractOperation implements IResourceDefinition
	{		
		private var _depends:Array;
		
		public function ResourceDefinition()
		{
		}
		
		public function get depends():Array 
		{
			return _depends;
		}
		
		public function set depends(value:Array):void 
		{
			_depends = value;
		}
		
		override public function canAct():Boolean
		{
			for each (var resource:IOperation in _depends)
			{
				if (!resource.isComplete())
				{
					return false;
				}
			}	
			
			return true;
		}

	}
}